package com.yuxi.al.single;

/**
 * 饿汉式单例
 * Created by yuxi on 2017/8/27.
 */
public class HurrySingle {
    public static void main(String[] args) {
        Single single1 = Single.getInstance();
        Single single2 = Single.getInstance();
        System.out.println(single1.equals(single2));
    }


}

class Single {
    private static Single single = new Single();

    private Single() {
    }

    public static Single getInstance() {
        return single;
    }

}